package com.zsr.xmall.ware.dao;

import com.zsr.common.to.ware.SkuHasStockTO;
import com.zsr.xmall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author zsrey
 * @email zsrey8880@163.com
 * @date 2022-06-09 23:34:41
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    /**
     * 将采购完成的sku商品入库
     * @param skuId
     * @param wareId
     * @param skuNum
     */
    void addStock(Long skuId, Long wareId, Integer skuNum);

    /**
     * 获取有效库存
     * @return
     */
    List<SkuHasStockTO> getSkusStock(@Param("skuIds") List<Long> skuIds);
}
